package com.pig.graduate.service.impl.material;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pig.graduate.common.exception.MyException;
import com.pig.graduate.domain.material.MaterialDeliver;
import com.pig.graduate.domain.material.MaterialInventory;
import com.pig.graduate.domain.material.MaterialStorage;
import com.pig.graduate.mapper.material.MaterialDeliverMapper;
import com.pig.graduate.result.MyResult;
import com.pig.graduate.service.material.MaterialInventoryService;
import com.pig.graduate.mapper.material.MaterialInventoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;

/**
* @author 星星眼
* @description 针对表【material_inventory(物料库存)】的数据库操作Service实现
* @createDate 2023-04-01 22:27:16
*/
@Service
public class MaterialInventoryServiceImpl extends ServiceImpl<MaterialInventoryMapper, MaterialInventory>
    implements MaterialInventoryService{


    @Autowired
    private MaterialInventoryMapper materialInventoryMapper;

    @Override
    public MyResult inventoryList(MaterialInventory materialInventory) {
        PageHelper.startPage(materialInventory.getPageNum(),materialInventory.getPageSize());
        List<MaterialInventory> list = materialInventoryMapper.materialList(materialInventory);
        PageInfo<MaterialInventory> pageInfo = new PageInfo<>(list);
        return MyResult.success(pageInfo);
    }

    @Override
    public MyResult getInventoryById(String id) {
        return MyResult.success(materialInventoryMapper.getInventoryById(id));
    }



}




